/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pvtracejava;

import java.util.Hashtable;

/**
 *
 * @author Administrator
 */
public class funInfo {

    private String funAddress = "";
    private String funNameString = "";
    private Hashtable<String, Integer> CallNum = new Hashtable<String,Integer>();
    private int CalledNum = 0;

    funInfo(String line, String funName) {
        funAddress = line;
        funNameString  = funName;
    }

    String getAddress() {
        return funAddress;
    }

    void Call(String tmpValue) {
        if (CallNum.containsKey(tmpValue)) {
            Integer num = CallNum.get(tmpValue);
            CallNum.put(tmpValue, new Integer(num.intValue() + 1));
        } else {
            CallNum.put(tmpValue, new Integer(1));
        }
    }

    boolean In(funInfo to) {
        if (CallNum.containsKey(to.getAddress())) {
            return true;
        }
        return false;
    }

    void PlusCall() {
        CalledNum++;
    }

    int GetCalled() {
         return   CalledNum;
    }

    String getfunName() {
         return  funNameString;
    }

    int InNum(funInfo to) {
        if (CallNum.containsKey(to.getAddress())) {
            return   CallNum.get(to.getAddress()).intValue();
        }
        return   0;
    }
}
